<%@ include file="/WEB-INF/html/skillManagement/common/init.jsp" %>
<%@page import="org.openwork.portlet.skillmanagement.RequiredNameException"%>

<%
SkillCategory skillCategory = (SkillCategory)request.getAttribute(WebKeys.SKILL_CAT_ATTR);
String backURL = ParamUtil.get(request, WebKeys.BACK_URL_PARAM, StringPool.BLANK);
String tabs1Values = "new-category";
String tabs1Names = tabs1Values;

PortletURL submitURL = renderResponse.createActionURL();
%>

<liferay-ui:tabs
	names="<%= tabs1Names %>"
	tabsValues="<%= tabs1Values %>"
	backURL="<%= backURL %>"
/>

<liferay-ui:error exception="<%= RequiredNameException.class %>" message="category-name-required"/>

<aui:form action="<%= submitURL %>" method="post">
	<aui:model-context bean="<%= skillCategory %>" model="<%= SkillCategory.class %>" />
	<aui:input name="name"/>
	<aui:input name="<%= WebKeys.SKILL_CAT_ID_PARAM %>" type="hidden" value="<%= (skillCategory != null)? skillCategory.getId() : "" %>"/>
	<aui:input type="hidden" name="struts.portlet.action" value="/view/updateSkillCategory"/>
	
	<br/>
	<aui:button-row>
		<aui:button name="saveButton" type="submit" value="save" />
		<aui:button name="cancelButton" type="submit" onClick="<%= "location.href = '" + backURL + "'; return false;" %>" value="cancel"  />
	</aui:button-row>
</aui:form>